package com.tanqing.ddd.web.controller;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanqing.ddd.web.entity.User;
import com.tanqing.ddd.web.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 首页
 */
@RestController
public class IndexController {

    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/")
    public String index() {
        return "welcome you";
    }

    @RequestMapping("/test")
    public void test(){
        List<User> users = userMapper.selectList(null);

        System.out.println(JSON.toJSONString(users));
    }
}
